{"ast":null,"code":"import _defineProperty from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport VerticalAlignTopOutlined from \"@ant-design/icons/es/icons/VerticalAlignTopOutlined\";\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport getScroll from '../_util/getScroll';\nimport { cloneElement } from '../_util/reactNode';\nimport scrollTo from '../_util/scrollTo';\nimport throttleByAnimationFrame from '../_util/throttleByAnimationFrame';\nimport warning from '../_util/warning';\nimport useStyle from './style';\nvar BackTop = function BackTop(props) {\n  var customizePrefixCls = props.prefixCls,\n    _props$className = props.className,\n    className = _props$className === void 0 ? '' : _props$className,\n    _props$visibilityHeig = props.visibilityHeight,\n    visibilityHeight = _props$visibilityHeig === void 0 ? 400 : _props$visibilityHeig,\n    target = props.target,\n    onClick = props.onClick,\n    _props$duration = props.duration,\n    duration = _props$duration === void 0 ? 450 : _props$duration;\n  var _React$useState = React.useState(visibilityHeight === 0),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    visible = _React$useState2[0],\n    setVisible = _React$useState2[1];\n  var ref = React.useRef(null);\n  var getDefaultTarget = function getDefaultTarget() {\n    return ref.current && ref.current.ownerDocument ? ref.current.ownerDocument : window;\n  };\n  var handleScroll = throttleByAnimationFrame(function (e) {\n    var scrollTop = getScroll(e.target, true);\n    setVisible(scrollTop >= visibilityHeight);\n  });\n  if (process.env.NODE_ENV !== 'production') {\n    process.env.NODE_ENV !== \"production\" ? warning(false, 'BackTop', '`BackTop` is deprecated, please use `FloatButton.BackTop` instead.') : void 0;\n  }\n  React.useEffect(function () {\n    var getTarget = target || getDefaultTarget;\n    var container = getTarget();\n    handleScroll({\n      target: container\n    });\n    container === null || container === void 0 ? void 0 : container.addEventListener('scroll', handleScroll);\n    return function () {\n      handleScroll.cancel();\n      container === null || container === void 0 ? void 0 : container.removeEventListener('scroll', handleScroll);\n    };\n  }, [target]);\n  var scrollToTop = function scrollToTop(e) {\n    scrollTo(0, {\n      getContainer: target || getDefaultTarget,\n      duration: duration\n    });\n    onClick === null || onClick === void 0 ? void 0 : onClick(e);\n  };\n  var _React$useContext = React.useContext(ConfigContext),\n    getPrefixCls = _React$useContext.getPrefixCls,\n    direction = _React$useContext.direction;\n  var prefixCls = getPrefixCls('back-top', customizePrefixCls);\n  var rootPrefixCls = getPrefixCls();\n  var _useStyle = useStyle(prefixCls),\n    _useStyle2 = _slicedToArray(_useStyle, 2),\n    wrapSSR = _useStyle2[0],\n    hashId = _useStyle2[1];\n  var classString = classNames(hashId, prefixCls, _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), className);\n  // fix https://fb.me/react-unknown-prop\n  var divProps = omit(props, ['prefixCls', 'className', 'children', 'visibilityHeight', 'target']);\n  var defaultElement = /*#__PURE__*/React.createElement(\"div\", {\n    className: \"\".concat(prefixCls, \"-content\")\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    className: \"\".concat(prefixCls, \"-icon\")\n  }, /*#__PURE__*/React.createElement(VerticalAlignTopOutlined, null)));\n  return wrapSSR( /*#__PURE__*/React.createElement(\"div\", Object.assign({}, divProps, {\n    className: classString,\n    onClick: scrollToTop,\n    ref: ref\n  }), /*#__PURE__*/React.createElement(CSSMotion, {\n    visible: visible,\n    motionName: \"\".concat(rootPrefixCls, \"-fade\")\n  }, function (_ref) {\n    var motionClassName = _ref.className;\n    return cloneElement(props.children || defaultElement, function (_ref2) {\n      var cloneCls = _ref2.className;\n      return {\n        className: classNames(motionClassName, cloneCls)\n      };\n    });\n  })));\n};\nexport default /*#__PURE__*/React.memo(BackTop);","map":{"version":3,"names":["VerticalAlignTopOutlined","classNames","CSSMotion","omit","React","ConfigContext","getScroll","cloneElement","scrollTo","throttleByAnimationFrame","warning","useStyle","BackTop","props","customizePrefixCls","prefixCls","className","visibilityHeight","target","onClick","duration","useState","visible","setVisible","ref","useRef","getDefaultTarget","current","ownerDocument","window","handleScroll","e","scrollTop","process","env","NODE_ENV","useEffect","getTarget","container","addEventListener","cancel","removeEventListener","scrollToTop","getContainer","useContext","getPrefixCls","direction","rootPrefixCls","wrapSSR","hashId","classString","divProps","defaultElement","createElement","Object","assign","motionName","_ref","motionClassName","children","_ref2","cloneCls","memo"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/back-top/index.js"],"sourcesContent":["import VerticalAlignTopOutlined from \"@ant-design/icons/es/icons/VerticalAlignTopOutlined\";\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport getScroll from '../_util/getScroll';\nimport { cloneElement } from '../_util/reactNode';\nimport scrollTo from '../_util/scrollTo';\nimport throttleByAnimationFrame from '../_util/throttleByAnimationFrame';\nimport warning from '../_util/warning';\nimport useStyle from './style';\nconst BackTop = props => {\n  const {\n    prefixCls: customizePrefixCls,\n    className = '',\n    visibilityHeight = 400,\n    target,\n    onClick,\n    duration = 450\n  } = props;\n  const [visible, setVisible] = React.useState(visibilityHeight === 0);\n  const ref = React.useRef(null);\n  const getDefaultTarget = () => ref.current && ref.current.ownerDocument ? ref.current.ownerDocument : window;\n  const handleScroll = throttleByAnimationFrame(e => {\n    const scrollTop = getScroll(e.target, true);\n    setVisible(scrollTop >= visibilityHeight);\n  });\n  if (process.env.NODE_ENV !== 'production') {\n    process.env.NODE_ENV !== \"production\" ? warning(false, 'BackTop', '`BackTop` is deprecated, please use `FloatButton.BackTop` instead.') : void 0;\n  }\n  React.useEffect(() => {\n    const getTarget = target || getDefaultTarget;\n    const container = getTarget();\n    handleScroll({\n      target: container\n    });\n    container === null || container === void 0 ? void 0 : container.addEventListener('scroll', handleScroll);\n    return () => {\n      handleScroll.cancel();\n      container === null || container === void 0 ? void 0 : container.removeEventListener('scroll', handleScroll);\n    };\n  }, [target]);\n  const scrollToTop = e => {\n    scrollTo(0, {\n      getContainer: target || getDefaultTarget,\n      duration\n    });\n    onClick === null || onClick === void 0 ? void 0 : onClick(e);\n  };\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('back-top', customizePrefixCls);\n  const rootPrefixCls = getPrefixCls();\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const classString = classNames(hashId, prefixCls, {\n    [`${prefixCls}-rtl`]: direction === 'rtl'\n  }, className);\n  // fix https://fb.me/react-unknown-prop\n  const divProps = omit(props, ['prefixCls', 'className', 'children', 'visibilityHeight', 'target']);\n  const defaultElement = /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-content`\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-icon`\n  }, /*#__PURE__*/React.createElement(VerticalAlignTopOutlined, null)));\n  return wrapSSR( /*#__PURE__*/React.createElement(\"div\", Object.assign({}, divProps, {\n    className: classString,\n    onClick: scrollToTop,\n    ref: ref\n  }), /*#__PURE__*/React.createElement(CSSMotion, {\n    visible: visible,\n    motionName: `${rootPrefixCls}-fade`\n  }, _ref => {\n    let {\n      className: motionClassName\n    } = _ref;\n    return cloneElement(props.children || defaultElement, _ref2 => {\n      let {\n        className: cloneCls\n      } = _ref2;\n      return {\n        className: classNames(motionClassName, cloneCls)\n      };\n    });\n  })));\n};\nexport default /*#__PURE__*/React.memo(BackTop);"],"mappings":";;AAAA,OAAOA,wBAAwB,MAAM,qDAAqD;AAC1F,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,WAAW;AACjC,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,SAASC,YA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